<template>
    <div class="box">
       <h3>子组件</h3>
       <h3>来自父组件值：{{ datafrom }}</h3>
       <el-button type="primary" @click="change">修改父组件值  <slot>test1</slot> </el-button>
    </div>
 </template>
 
 <script setup lang='ts'>
    import {ref, reactive} from 'vue'
    const props = defineProps(['datafrom'])
    const emits = defineEmits(['changeData'])
 
    const change = ()=>{
       emits('changeData',props.datafrom+1)
    }
 </script>
 
 <style lang='less' scoped>
    .box{
       border: 1px solid #ccc;
    }
 </style>